#pragma once

#include "Action.h"
#include "PublicKey.h"
#include "SymmetricKeyInfo.h"

#include <QStringList>
#include <vector>

namespace kryptos { namespace actions {

typedef std::vector<kryptos::cryptography::PublicKey> RecipientVector;

class ActionEncrypt : public Action
{
Q_OBJECT
public:

    enum SourceType { FILE, SELECTION};

    ActionEncrypt(std::vector<unsigned char> selection,
                  SourceType                 sourceType,
                  RecipientVector            recipientsKeys,
                  kryptos::entities::SymmetricKeyInfoList symmetricKeys=kryptos::entities::SymmetricKeyInfoList());
    ~ActionEncrypt();

    std::vector<unsigned char> encryptedSelection();

protected:
    // Action Methods
    virtual bool Prepare  ();
    virtual void RunAction();
    virtual bool Cleanup  ();

private:

    void encryptFiles    ();
    void encryptSelection();

    std::vector<unsigned char> m_selection;
    std::vector<unsigned char> m_encryptedSelection;
    SourceType                 m_sourceType;
    RecipientVector            m_recipients;
    std::string                m_encryptedFile, m_encryptedFileTmp, m_compressedFileName;
    kryptos::entities::SymmetricKeyInfoList m_symmetricKeys;
};

}}
